using System;
using UnityEngine;


public class PlayerNetHandler: Singleton< PlayerNetHandler > 
{
	
	void Awake ()
	{
		if ( mInstance == null )
		{
			mInstance = this;
			initHandler();
		}
		
	}
	
	public void initHandler()
	{
		GameSocketManager.instance.regeditMsg( (int)GameNetMessage.MsgType._MSG_RECV_ROLE_INFO , onRecvRoleInfo , typeof( GameNetMessage.RECV_MSG_ROLE_INFO ) );
		GameSocketManager.instance.regeditMsg( (int)GameNetMessage.MsgType._MSG_RECV_PET_INFO , onRecvPetInfo , typeof( GameNetMessage.RECV_MSG_PET_INFO ) );



	}
	

	public PlayerNetHandler ()
	{

	}


	public unsafe void onRecvRoleInfo( GameNetMessage.NetMsgInterface head )
	{
		GameNetMessage.RECV_MSG_ROLE_INFO msg = ( GameNetMessage.RECV_MSG_ROLE_INFO )head;

		GamePlayerData.instance.creatureData = msg.Data;
		GamePlayerData.instance.Stone = msg.Stone;

		//SAItemData;
	}


	public unsafe void onRecvPetInfo( GameNetMessage.NetMsgInterface head )
	{
		GameNetMessage.RECV_MSG_PET_INFO msg = ( GameNetMessage.RECV_MSG_PET_INFO )head;

		//SAPetData
	}

}

